UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zxWv/FYwUA/elEbxNnnDhrd+tT4aNDpM2CUpRwFvgE0='
WHERE
key_id = 'a69181e20c372a1338020f3d8d1f1f34d0f34468e8f8b67012059a9c76d5a40e'
AND (
token = 'zxWv/FYwUA/elEbxNnnDhrd+tT4aNDpM2CUpRwFvgE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)