UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HW4E26MVXt8/v+BB3qNiBYUbgH2l7pi9XD+99+vmFzA=' 
WHERE 
  key_id = '1683143aceb8fd802b553315c08a3599bf6dcffea9e7bbfb3688750778b34267' 
  AND (
    token = 'HW4E26MVXt8/v+BB3qNiBYUbgH2l7pi9XD+99+vmFzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030