UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10vtktMPq13jWvzL8cmnIzqGTPm+q2YSfWtGbyzqJw4='
WHERE
key_id = '59ae2b91bf0336faea23d7520a0d3ce16f3b64a6073c7a61d11edb4172e1eb47'
AND (
token = '10vtktMPq13jWvzL8cmnIzqGTPm+q2YSfWtGbyzqJw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)