UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'siv0ljCghfejPeLV4uA1fEx/3m4BdjqzkQf9jrexUEI=' 
WHERE 
  key_id = 'e34189f08a274d7fd8e66ad12ea2cd55c7a069f3289a30b24eedcf2ef6743ad6' 
  AND (
    token = 'siv0ljCghfejPeLV4uA1fEx/3m4BdjqzkQf9jrexUEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039