UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ms8u0l85A4nfGof5gUVrX3A2gHRUAwW4qubfQF+z9hs=' 
WHERE 
  key_id = '3676200571ef3dc66e3babeab8b193e3553f2d52f24e31e88c7c311d1863d46b' 
  AND (
    token = 'Ms8u0l85A4nfGof5gUVrX3A2gHRUAwW4qubfQF+z9hs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030