UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GKlggnlG6F8V/0yGPOPMuk/ln2n5pSb7FeTw3CJk3a8=' 
WHERE 
  key_id = '99cdfbc300e2418907a5b3188d9bc971cb13c1f04dac4cfdc575ff95f096c7ff' 
  AND (
    token = 'GKlggnlG6F8V/0yGPOPMuk/ln2n5pSb7FeTw3CJk3a8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029