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