UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kDahVXUckTPvjWtuPBxgOK+Nm4KXolBO3Os8VC8FO40=' 
WHERE 
  key_id = '08f601daf7b2c9a93f30e352f4eee56cc8f46b70491ef4144b267de5429b8b3c' 
  AND (
    token = 'kDahVXUckTPvjWtuPBxgOK+Nm4KXolBO3Os8VC8FO40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034