UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lQ+2xMJRoZnp24K6XLWJKEuY0LY0e34XCQTfAjbIeYY='
WHERE
key_id = '8568e299fb0f3a4fd507e4590c10d8cd3ce63a13355295f538d3288b596ebf55'
AND (
token = 'lQ+2xMJRoZnp24K6XLWJKEuY0LY0e34XCQTfAjbIeYY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)