UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'afedt3Q3b4F2X+UeNG82rPlCxyhehQkXzDS1tTfQoNI=' 
WHERE 
  key_id = '71361a6c9b777d34f1f5caa8d5700b03b0a07a55a8f13604379e25589b397819' 
  AND (
    token = 'afedt3Q3b4F2X+UeNG82rPlCxyhehQkXzDS1tTfQoNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020