UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q1oGiPP7ljacXAOkm2YXB4aPImfMDcV/KXDAesyUReM=' 
WHERE 
  key_id = '78d204e6fbd9ca9e763e912823d5e86c0cbc093e897d5775cd69856d55f18141' 
  AND (
    token = 'q1oGiPP7ljacXAOkm2YXB4aPImfMDcV/KXDAesyUReM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025