UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NxhLTsl2moMP/41sxzgHYu3OBH9J3yQGxD+M0mjt5hk='
WHERE
key_id = '9c5b9ff43c3aab994debbacf6a39fcc2bb78a1d1cb063eafa8b65f4f076f8353'
AND (
token = 'NxhLTsl2moMP/41sxzgHYu3OBH9J3yQGxD+M0mjt5hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)