UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vcx8lMMVXCQFOzzWCw7HLyiWWB5aXJs29+X/1INAbpQ=' 
WHERE 
  key_id = 'bff32d4e966ffad5472b4539659cea223ce310dd11a6e681d6badfbf4a43f455' 
  AND (
    token = 'Vcx8lMMVXCQFOzzWCw7HLyiWWB5aXJs29+X/1INAbpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027