UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DzMT73Tn2lae9a6dSYPah4dC6oeCwcU7jy0iBs6po7Y=' 
WHERE 
  key_id = 'f3f50c90721c327074f7952a5fb7c82499559f35a48ac9b853f6e9568f764511' 
  AND (
    token = 'DzMT73Tn2lae9a6dSYPah4dC6oeCwcU7jy0iBs6po7Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033