UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VHDrJHrDZc+pOjAQuV6k2uhHauqI8D/WEKt3JAoihfE=' 
WHERE 
  key_id = 'b0aa935616bcf0238d280042e36dd119ffce352ba5cf727bb4407dce04821c87' 
  AND (
    token = 'VHDrJHrDZc+pOjAQuV6k2uhHauqI8D/WEKt3JAoihfE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043