UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D5cS9xu+1snL+WT69zCOlKEhRg1TjiCjQiTwvrLI2nw=' 
WHERE 
  key_id = '7a37cfa6c1db791feb6fb6e7854183aba8f9d08e4492bca784c77e6910cf9bc4' 
  AND (
    token = 'D5cS9xu+1snL+WT69zCOlKEhRg1TjiCjQiTwvrLI2nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029