UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qlIRLLnAJtNoOhhnnxbTQ/v0DjhyGtf4FW5oSmBZXVs=' 
WHERE 
  key_id = '74e315c43926e12c91bd669c208c73791a2b9f861d8fa5e783b8f897cf9fc3db' 
  AND (
    token = 'qlIRLLnAJtNoOhhnnxbTQ/v0DjhyGtf4FW5oSmBZXVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060