UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/7zzztTfib/k5HbopdS3ZRjBJtdBr5CfalYh7tx3qSs=' 
WHERE 
  key_id = 'b4e6bc43921027d81e5cd0170afbc68ad2cee496b526297f16b2538f52240749' 
  AND (
    token = '/7zzztTfib/k5HbopdS3ZRjBJtdBr5CfalYh7tx3qSs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035