UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+6LirB/EgvuzccEy5w5sNHMWCbf9nhv3YK/GFOVweFs=' 
WHERE 
  key_id = '9cbb00c6cfee8c6a0263c0f20ed8d24b0f0451496554d891644bdfc822746146' 
  AND (
    token = '+6LirB/EgvuzccEy5w5sNHMWCbf9nhv3YK/GFOVweFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038