UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vXbxdd1UB4A2sQqqxzfcxdKqLUq0sFr9s0yXP1b5CCQ=' 
WHERE 
  key_id = '1646b236e9ee72fb71b218d33b024494630b468b26634c0c6c1d70f0f517d068' 
  AND (
    token = 'vXbxdd1UB4A2sQqqxzfcxdKqLUq0sFr9s0yXP1b5CCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023