UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VKETa80uTo7NqZl9eIJSaLdnwSSzIrfTwVfQP7kSJQg='
WHERE
key_id = 'bc97974bd8428d61f2abd0a8d5e93858d03871334a05ece3864bf8e75e44bad2'
AND (
token = 'VKETa80uTo7NqZl9eIJSaLdnwSSzIrfTwVfQP7kSJQg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)