UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd77tNlP27kxk1K6SNumCn+4MoO90PaxBDj3DYuNGVmA='
WHERE
key_id = '25793181b138cb608dee9dfdbd00f7fe7cbc063c6a65fbd23f0cecc4efe75148'
AND (
token = 'd77tNlP27kxk1K6SNumCn+4MoO90PaxBDj3DYuNGVmA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)