UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3XX89e64YNLFnQvaURphRZ5EaM1ZStdZoupme/XuaBk=' 
WHERE 
  key_id = 'b6acfe6f51eed7144af7b27b3fff7f8eb9bd6efe617d83484e483dfb8ccda839' 
  AND (
    token = '3XX89e64YNLFnQvaURphRZ5EaM1ZStdZoupme/XuaBk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032