UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LxvEvmY9StD8v6glu576Xtf1dQ3Ak5JfOVkZzjxXfmI=' 
WHERE 
  key_id = 'de6ac96f768e8a5aa139761e42a4374ec4df7b64d3144e1cdea34b9253f6efd5' 
  AND (
    token = 'LxvEvmY9StD8v6glu576Xtf1dQ3Ak5JfOVkZzjxXfmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027