UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CnZCvGVhsUs2S7hWqiftq3/QiSaY2TC6yhohgfAlwQA='
WHERE
key_id = 'b0a691e6d0c5b7018347cd52fd752e49b237b715e292cf413f857d6dd5026527'
AND (
token = 'CnZCvGVhsUs2S7hWqiftq3/QiSaY2TC6yhohgfAlwQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)