UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VeTh24h055CcqutTHv6KS2pD2Q5q9ir9aVzU2uaE4/8=' 
WHERE 
  key_id = '1ad8bfe190ec18ed111a39ca387280bb2fc047237960b1f82fce06fbcf25d6ef' 
  AND (
    token = 'VeTh24h055CcqutTHv6KS2pD2Q5q9ir9aVzU2uaE4/8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035