UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/XZYAMyHoOU6ln2TJwZpbgEwVLTbM163qZveb3BFdiA='
WHERE
key_id = 'c03dd5d9f395491466f1b02c94d34e5dbb586fd848f49e255e21d99830506e4c'
AND (
token = '/XZYAMyHoOU6ln2TJwZpbgEwVLTbM163qZveb3BFdiA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)