UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qwA/97tyNrRzaP8M3IUCRW+LZVp/ozWc4JZzBYfeOCw='
WHERE
key_id = '7261c2263ab103a04e1b703f46cb16d05b2ec3d915c62474f77273e60d79b4ac'
AND (
token = 'qwA/97tyNrRzaP8M3IUCRW+LZVp/ozWc4JZzBYfeOCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)