UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e5t4oInDXI8zM6lgnAs5FgFtIkXSRQba4XBZuxfHHqs='
WHERE
key_id = '884a1f7262c542c7c50351da19cdf5827bca2c78cee08ec47f7dd0901eaa5a46'
AND (
token = 'e5t4oInDXI8zM6lgnAs5FgFtIkXSRQba4XBZuxfHHqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)