UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TbZ5ed8ei9KBgZZAAFWqOxdUpOReyc5Bk2bPxxC/O5s=' 
WHERE 
  key_id = 'f168e434fa2940253619cbc60d10ec327dcea114199be4daa2d38d4ad6522e84' 
  AND (
    token = 'TbZ5ed8ei9KBgZZAAFWqOxdUpOReyc5Bk2bPxxC/O5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038