UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U9bFS7rl5ZOylXVaYB51amUYplRC/AYMtdSj5Mu0iS4='
WHERE
key_id = '8c05e3c99ad2387f7dd9a9cb1198815b56a11488d1d2dac66777e3eeb84d98d2'
AND (
token = 'U9bFS7rl5ZOylXVaYB51amUYplRC/AYMtdSj5Mu0iS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)