UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dVD7oigmJ4xA7vBG/Oublg7EldGXz5kvVCvPY5dqAE4=' 
WHERE 
  key_id = '74e6ddcb7ffe057ff2491d6744d193032b5f0e20d5ffda66e2d9ef315dc64708' 
  AND (
    token = 'dVD7oigmJ4xA7vBG/Oublg7EldGXz5kvVCvPY5dqAE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025