UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DfRWiIo9fSSOKYQuFupFxXcGwPk7d5MKL4lV82EmW/E='
WHERE
key_id = '77e7858ac214f77b9eb4877af3da574377829bb57e0a24fb453151d7bfbceba5'
AND (
token = 'DfRWiIo9fSSOKYQuFupFxXcGwPk7d5MKL4lV82EmW/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)