UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Ar46C5RPno98bYZ+920yO/d6ALxYbLFsxdOr73W2Z0=' 
WHERE 
  key_id = '1faf60e7fe25a60ee2bb3112a81ca21573dd8cae0e01379b6a8aae76c1a0945c' 
  AND (
    token = '5Ar46C5RPno98bYZ+920yO/d6ALxYbLFsxdOr73W2Z0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047