UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ytI2dSxaJo4iJcY2Y4ieZKJxm7xvJe+8mgwVrXYbbQ='
WHERE
key_id = '69e59c433d781482ef996a8d3d280dfe175da7e5065116abd0078543a8989e51'
AND (
token = '9ytI2dSxaJo4iJcY2Y4ieZKJxm7xvJe+8mgwVrXYbbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)