UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+6kafED5qpkRMwJbfbHBjKwkVgiSpCD/M4GTMX5MZnQ=' 
WHERE 
  key_id = '7b2cc053f8e6031467873355a7e15d375a2b5c6ffdf3bf0b9a3c10d83c81a4df' 
  AND (
    token = '+6kafED5qpkRMwJbfbHBjKwkVgiSpCD/M4GTMX5MZnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032