UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZrsPkJyqK/GBahkFeen/FiuGGVzrHFQlo3OomM/ztnM='
WHERE
key_id = '785b933a183fd0d386759488277ab7ccc8bc6d70760c3727e83f480d44853433'
AND (
token = 'ZrsPkJyqK/GBahkFeen/FiuGGVzrHFQlo3OomM/ztnM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)