UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0H9R2NHK2EQ5QbDqf49eFoJghpTZbDMd5lPVaBUuyto=' 
WHERE 
  key_id = '1295bfac86a3143d50e59dd9e7c0941ed1238ca3b5dd789d03be510e6bc0542b' 
  AND (
    token = '0H9R2NHK2EQ5QbDqf49eFoJghpTZbDMd5lPVaBUuyto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029