UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gewxn0Ny1d7QiL+hEJRtQJC+3Wn5dHl90N65zUzorqY=' 
WHERE 
  key_id = '654a714d589ede2c3e17fd9517973ccd32354199bdd578ef823852ce5e0d545c' 
  AND (
    token = 'gewxn0Ny1d7QiL+hEJRtQJC+3Wn5dHl90N65zUzorqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023