UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7659PkffAczpwIolX5PAZydH6YkhHQs9J+d9sBDrPLE='
WHERE
key_id = '5721a627fc5b1a854ed7635fba63e3f316a80cac9ab57b9d2ed45a2f45c194cd'
AND (
token = '7659PkffAczpwIolX5PAZydH6YkhHQs9J+d9sBDrPLE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)