UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dNbkvYNTA7YKTpF+AcRQRgQAIt23tzjsr7wuTE+VwgM=' 
WHERE 
  key_id = '76d424a2c813eb7e777713ef21f05c88239c5c2783af7c89242d1888c4cda488' 
  AND (
    token = 'dNbkvYNTA7YKTpF+AcRQRgQAIt23tzjsr7wuTE+VwgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021