UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oDZFXVHocSRc1JSroVn4NkMxbECsnAx4piNDbFg1PRU=' 
WHERE 
  key_id = '2dfe6f650d11adfacaf3958f785e492eafb42163c3188ce2370ce12aa726eae2' 
  AND (
    token = 'oDZFXVHocSRc1JSroVn4NkMxbECsnAx4piNDbFg1PRU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040