UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ySrIWQSKhGSCggHlRSnLUdue/sNJ96o2BxIfuMmcx3A=' 
WHERE 
  key_id = '15d1e93125b7d1c3b8d1b9c01b3eef145cb609ffbae369d253b4bf8a77d9bf4f' 
  AND (
    token = 'ySrIWQSKhGSCggHlRSnLUdue/sNJ96o2BxIfuMmcx3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060