UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HittpBGtZY4N2N3jSBRvVChaBkyjszO1Oj1/BIpXpoU=' 
WHERE 
  key_id = '191d6a2179b8b0ff757367b8437ff333cf9c56123d0234407b99cdf51e3859e6' 
  AND (
    token = 'HittpBGtZY4N2N3jSBRvVChaBkyjszO1Oj1/BIpXpoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035