UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QIComNiD0hS2JI5UZvE+ywgwOmV1KRVAgTPlQPWlHB4='
WHERE
key_id = 'caed247ba129cb49eb3caa2599e12f5e42a3d600cbc7aa0642700e79011b67aa'
AND (
token = 'QIComNiD0hS2JI5UZvE+ywgwOmV1KRVAgTPlQPWlHB4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)