UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XxOvkOr8QSufqp+7vWcsXMTQryIfAwlzorbkF5wYz5s=' 
WHERE 
  key_id = 'f75d338681e2199399539861f7127b00526f12bb83ab6a64576106cd0c37de56' 
  AND (
    token = 'XxOvkOr8QSufqp+7vWcsXMTQryIfAwlzorbkF5wYz5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014