UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z98lyFY6/+rKXbmdq43n39ppkTNJJgfktC33CQ3wC1U=' 
WHERE 
  key_id = '75538eeceda55cb1ae03df49c505d5d20ca41a4fa1f405e434a2da65f9e37c1b' 
  AND (
    token = 'Z98lyFY6/+rKXbmdq43n39ppkTNJJgfktC33CQ3wC1U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044