UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rXLxw+sGYQTP6eUlPsfTS5O0OC7dXMeYiXUy1XLs05c='
WHERE
key_id = 'defa398682bb0140271f26b7d3c6cc215bb6069c91dc4ba261a622a744c467f6'
AND (
token = 'rXLxw+sGYQTP6eUlPsfTS5O0OC7dXMeYiXUy1XLs05c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)