UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+B72oFMVUvZ7ZvyHcY17v1eO+M0Ri2dyjg24CMyKjGE='
WHERE
key_id = '4bf371a6651d964b7cdee2fb6b4b9bc493f05d6f266bab4b7ddc52842c81dd40'
AND (
token = '+B72oFMVUvZ7ZvyHcY17v1eO+M0Ri2dyjg24CMyKjGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)