UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7D7+AVObQ7RVsVxBMRLflzqXZ3raSftmBHxcIF9UKMk='
WHERE
key_id = '9bd0f56023e52640ae1f4ef2c64bcf27d625d722e974ad04216a880da38c2f48'
AND (
token = '7D7+AVObQ7RVsVxBMRLflzqXZ3raSftmBHxcIF9UKMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)