UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOa56bk4Jw8dNEKYv2PMYXehHi3tAxdn1br2PLcrDlI='
WHERE
key_id = 'adcc93883326821e757ff3d4c1eec21071038eca841cd70ed968bca5cbaef8f9'
AND (
token = 'uOa56bk4Jw8dNEKYv2PMYXehHi3tAxdn1br2PLcrDlI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)