UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ARKSKtjl0NHLxOzXQTdMk/cwJ2hj+c1+ljZa8gR1soc=' 
WHERE 
  key_id = 'ab30c270247cb86d3ebea87d318e8218274307aaa36c76ae4e38116c7986f65f' 
  AND (
    token = 'ARKSKtjl0NHLxOzXQTdMk/cwJ2hj+c1+ljZa8gR1soc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040