UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k3gHkOaPU3/dNa3bK+bLcRybQv/RYjYyFkk5TxDnpgw='
WHERE
key_id = '5ee34dceb3e48bf9766b55c582db7504ead42e2007af04557220171b780a00d9'
AND (
token = 'k3gHkOaPU3/dNa3bK+bLcRybQv/RYjYyFkk5TxDnpgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)