UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DY6wn2prHc2y0cEsq97ELI5dKrApg7fIkVZF6Ce33Fs=' 
WHERE 
  key_id = '89240000e33ce9860001f7acef9e78b3871075023d10d0e4121a7597731e1c06' 
  AND (
    token = 'DY6wn2prHc2y0cEsq97ELI5dKrApg7fIkVZF6Ce33Fs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042