UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YmkC61g8RJhAvr7V8/0ZerCN+sOrOHtJ/TEdHHpL4bw='
WHERE
key_id = '7e8bf78a21138d11718df56b0b81c2a4b33d0d76b75c2ed0a5f1719958b276e7'
AND (
token = 'YmkC61g8RJhAvr7V8/0ZerCN+sOrOHtJ/TEdHHpL4bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)