UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QvgDyDCibFU7MFgmSrRl4BkoZ1q4afOGI+PpsI0QvjA=' 
WHERE 
  key_id = '0773b10325262a1c8e49ed5536768386bb2fa8b9d6d73eb193a8f4a5f1a4b609' 
  AND (
    token = 'QvgDyDCibFU7MFgmSrRl4BkoZ1q4afOGI+PpsI0QvjA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040