UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BB3RSPvNQa22QPIVugL8rPkME3FK/xd8JRLG6k08dLM='
WHERE
key_id = '971e35d4659ebd49d8bcaba76af857b74449e6cff8c5e72dd7121624b227ab5b'
AND (
token = 'BB3RSPvNQa22QPIVugL8rPkME3FK/xd8JRLG6k08dLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)