UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VE2WWKGNMyuoR5VKVaBQaeOcd8j+b8FNbeNdhxedleY=' 
WHERE 
  key_id = '48b971fa5e9ba8af52da2807fff8418cb1ad3ee261e49a7be1c7353476171b66' 
  AND (
    token = 'VE2WWKGNMyuoR5VKVaBQaeOcd8j+b8FNbeNdhxedleY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025