UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9L3dB+w/qA2yzBo3RHTKIS7Q/1xULBDjUiFudQSWFbc=' 
WHERE 
  key_id = '1bbe31447b327a9def057dce4a67b859ce2b5f9d2651880e20860f41c1780853' 
  AND (
    token = '9L3dB+w/qA2yzBo3RHTKIS7Q/1xULBDjUiFudQSWFbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019