UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vWvJnK5fK581lFy5Jc8wHT/8Iuz7Bmn+z4CcDbXRRFU=' 
WHERE 
  key_id = 'd45cb0010cab89e34459f4d2105142143ad37fa007355eb9c70f7b44f006136f' 
  AND (
    token = 'vWvJnK5fK581lFy5Jc8wHT/8Iuz7Bmn+z4CcDbXRRFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019