UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mKC0JX/7aI7crzYgxFmyz6otX69rJn/ZggKF0yJGATY=' 
WHERE 
  key_id = '5f54945881f89fde6a6c41f6d6bc9b12d4d1fdedb86ae4ae33cce1bdb235241e' 
  AND (
    token = 'mKC0JX/7aI7crzYgxFmyz6otX69rJn/ZggKF0yJGATY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056