UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OF5mcgnv/QsiOwRfVsqaQVCFuLA+egEgust9X7tCrUw=' 
WHERE 
  key_id = 'cfd40f6ae75e62e3a53f94656d00f8f9e61385438078be5a31d7ed4774d71a90' 
  AND (
    token = 'OF5mcgnv/QsiOwRfVsqaQVCFuLA+egEgust9X7tCrUw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022