UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ZV+a9NruCRxZASle7qBgE4vVWZz3yQfaxmTXcVwdvk=' 
WHERE 
  key_id = '64d99f9aecdab39e4a955c1eedc61f5af73f10e049011c9cb59a3ff08ba007c3' 
  AND (
    token = '6ZV+a9NruCRxZASle7qBgE4vVWZz3yQfaxmTXcVwdvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029