UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lfftXS6BUcG1abezaWjPmpIuVY8KwiG6tMqHuDqLV4U=' 
WHERE 
  key_id = '5b1eeda0739875d53f229359675a159eacc3e996e6270c58e4d6bf96f6e5681a' 
  AND (
    token = 'lfftXS6BUcG1abezaWjPmpIuVY8KwiG6tMqHuDqLV4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035