UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jiiffjbuPJWTV7cR4UaJuu2AIR/eKfV0Z0cApmC8dUU=' 
WHERE 
  key_id = 'e2a4c065216cff9a67d86d5a8429dad0c960fce1f499d3ad89d175e0a6f4a7c2' 
  AND (
    token = 'jiiffjbuPJWTV7cR4UaJuu2AIR/eKfV0Z0cApmC8dUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021